@extends('front.common.header')
@section('title','充值中心')

@section('head')
@parent
@stop

@section('content')
<link href="{{ asset('/css/company/jobs.css') }}" rel="stylesheet" type="text/css">
<link href="{{ asset('/css/company/comdetails.css') }}" rel="stylesheet" type="text/css">

<div id="jobs-main-content">
    <div id="recharge-wrap">
        <form action="{{url('/member/recharge/trade')}}" method="post" onsubmit="return checkOrder();">
            <div class="recharge-title">充值中心</div>
            <div class="recharge-info">
                <div class="recharge-tit">积分价格：<span style="color: #fe5f01">1元=10积分</span></div>
                <div class="recharge-money" id="pay-money-select">
                   <span>充值金额：</span>
                   <a class="amount-item" href="javascript:void(0)" name="radio-money" money="5" id="money1">
                      <span>5元</span><b class="icon"></b>
                   </a>
                   <a class="amount-item" href="javascript:void(0)" name="radio-money" money="10" id="money2">
                      <span>10元</span><b class="icon"></b>
                   </a>
                   <a class="amount-item" href="javascript:void(0)" name="radio-money" money="50" id="money3">
                      <span>50元</span><b class="icon"></b>
                   </a>
                   <a class="amount-item" href="javascript:void(0)" name="radio-money" money="100" id="money4">
                      <span>100元</span><b class="icon"></b>
                   </a>
                   <a class="amount-item" href="javascript:void(0)" name="radio-money" money="200" id="money5">
                      <span>200元</span><b class="icon"></b>
                   </a>
                   <span class="ml60">其他金额：</span>
                   <input type="hidden" name="fixed_price" value="">
                   <input type="text" class="amount-item" name="order_price" value="">元
                </div>
            </div>
            <input type="hidden" name="payment_type" value="">
            <div class="recharge-info">
                <div class="recharge-tit">选择支付方式：</div>
                <div class="recharge-bank">
                    <ul class="clearfix">
                        <li class="bank bank-zfb" banktype="zfb" title="支付宝" name="alipay">
                            <b class="icon"></b>
                        </li>
                    </ul>
                </div>
            </div>
            {!! csrf_field() !!}
            <div class="recharge-bottom">
                <a href="{{url('/member/account')}}">取&nbsp;&nbsp;消</a>
                <button type="submit" name="submit">确&nbsp;&nbsp;定</button>
            </div>
        </form>
    </div>
</div>
<script>
    $(function(){
        $(".recharge-money a").on("click",function(){
            $(this).addClass("amount-item-selected");
            var order_price = $(this).attr('money');
            $('input[name=fixed_price]').val(order_price);
            $(this).prevAll().removeClass("amount-item-selected");
            $(this).nextAll().removeClass("amount-item-selected");　　                                           
        });
        $(".recharge-money a").dblclick(function(){
            $(this).removeClass("amount-item-selected");
        });
        $(".bank").on("click",function(){
			$(this).addClass("amount-item-selected");
			var payment_type = $(this).attr('name');
			$('input[name=payment_type]').val(payment_type);
			$(this).prevAll().removeClass("amount-item-selected");
            $(this).nextAll().removeClass("amount-item-selected");　
        });
    });
    function checkOrder()
    {
		var fixed_price = $('input[name=fixed_price]').val();
		var order_price = $('input[name=order_price]').val();
		var payment_type = $('input[name=payment_type]').val();
		if((fixed_price == "" || fixed_price == 'undefined' || fixed_price == null) && (order_price == "" || order_price == 'undefined' || order_price == null)){
			layer.msg('请选择金额！');
			return false;
		}
		if(payment_type == '' || payment_type == 'undefined' || payment_type == null){
			layer.msg('请选择支付方式！');
			return false;
		}
		
    }
</script>

@stop

@section('footer')
@parent
@stop

